<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrderGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('order_goods', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('orderId')->unsigned()->comment('订单id');
            $table->integer('goodsId')->unsigned()->comment('产品id');
            $table->integer('company')->unsigned()->comment('公司');
            $table->string('name')->nullable()->comment('品名');
            $table->string('code',128)->unique()->comment('编号');
            $table->string('type')->nullable()->comment('类型');
            $table->string('brand')->nullable()->comment('品牌');
            $table->string('size')->nullable()->comment('尺码');
            $table->string('color')->nullable()->comment('颜色');
            $table->string('unit')->nullable()->comment('计算单位');
            $table->float('count',11,2)->nullable()->comment('数量');
            $table->string('storage')->nullable()->comment('库房');
            $table->string('info')->nullable()->comment('属性');
            $table->float('weight')->nullable()->unsigned()->comment('重量');
            $table->float('price',11,2)->nullable()->unsigned()->comment('单价');
            $table->float('discount',11,2)->nullable()->unsigned()->comment('折扣');
            $table->float('inPrice',11,2)->nullable()->unsigned()->comment('单价');
            $table->float('salePrice',11,2)->nullable()->unsigned()->comment('销售单价');
            $table->float('cost',11,2)->nullable()->comment('总价');
            $table->string('costUnit')->nullable()->comment('币种');
            $table->string('log')->nullable()->comment('记录');
            $table->string('img')->nullable()->comment('图片地址');
            $table->string('notes')->nullable()->comment('备注');
            $table->string('other1')->nullable()->comment('其他信息');
            $table->string('other2')->nullable()->comment('其他信息');
            $table->string('other3')->nullable()->comment('其他信息');
            $table->string('other4')->nullable()->comment('其他信息');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('order_goods');
    }
}
